<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            width: 200px;
            height: 200px;
            background-color: slateblue;
        }
    </style>
</head>
<body>
    <img src="./img/1.jpg" alt="">
    <div></div>
    <script src="https://cdn.bootcdn.net/ajax/libs/fastclick/1.0.6/fastclick.min.js"></script>
    <!-- <script src="./js/fastclick.js"></script> -->
    <!-- 打开网页时注意用火狐，谷歌等浏览器 -->
    <script>

        // var time = null;
        // // document结构完善之后，该事件触发
        // // DOMContentLoaded是h5新增，打印时间比load快
        // document.addEventListener("DOMContentLoaded",function(){
        //     console.log("DOMContentLoaded");
        //     time = Date.now();

        // })

        // window.addEventListener("load",function(){
        //     console.log("load");
        //     console.log(Date.now() - time);

        // })


        document.addEventListener("DOMContentLoaded",function(){
            FastClick.attach(document.body);
            
        })

        var div = document.querySelector("div");

        div.addEventListener("click",function(){
            console.log(1)
        })
    </script>
</body>
</html>